﻿using System.Collections.Generic;

namespace ButtonBuilder.Plugin
{
    public class GotoPageAction : Action
    {
        public GotoPageAction() : base()
        {
            Name = "Goto Page";
        }

        public GotoPageAction(string page) : this()
        {
            Parameters.Add(new ActionParam() 
            { 
                Name = "Page", 
                Type = typeof(string).FullName, 
                Value = page 
            });
        }

        public override void Init()
        {
            base.Init();
        }

        public override ActionResult DoIt()
        {
            return new ActionResult()
            {
                Source = this,
                NextPage = GetParam("Page")
            };
        }
    }
}
